#include <iostream>

using std::cin;
using std::cout;
using std::endl;

// const修饰的左值引用右值
void Test1()
{
    int &&rval = 3;
    // 右值引用之后就变成了左值
    // int& lval = rval;
    const int &lval = 3;
    std::cout << "rval: " << rval << std::endl;
    std::cout << "lval: " << lval << std::endl;

    // rval
    rval++;
    std::cout << "rval: " << rval << std::endl;
    std::cout << "lval: " << lval << std::endl;
}

void Test2()
{
    char buff[4];
    
    int a = 10;
    std::cout << "&a: " << &a << std::endl;
    std::cout << "buff: " << (int*)(buff - 4) << std::endl;
    
    std::cout << "a is " << a << std::endl;

    buff[-4] = 0;
    std::cout << "a is " << a << std::endl;
}

int main()
{
    Test2();
    return 0;
}